//#include <stdbool.h>
#include <REG52.h>
#include "define_rsb.h"
//gpio 0 : as tick clock
//extern gpio_reg_p const gpio ; 
//extern unsigned char TICK_CLK;
void gpio_init( void )
{ gpio_reg_p gpio = (gpio_reg_p)DEF_XADR_GPIO;
 // intc_reg_p intc = (intc_reg_p)DEF_XADR_INTC;
  volatile unsigned char tmp;
  gpio->oe[0] = 0x1;
  //intc->int_mask = 0x00000004;
}

void isr_gpio0(void) interrupt ISR_GPIO
{  gpio_reg_p gpio = (gpio_reg_p)DEF_XADR_GPIO;
  volatile unsigned char tmp;
  tmp=gpio->int_latch[0];
  tmp=gpio->int_latch[1]<<8;
  if(tmp&0x0001)
    gpio->out_toggle = 0x0;
}
